import { ApiCall } from "tsrpc";
import { ReqRegister, ResRegister } from "../../../tsrpc/shared/protocols/gate/PtlRegister";
import { gs } from "../../../GateServiceEntra";

export default async function (call: ApiCall<ReqRegister, ResRegister>) {
    // TODO
    const ret = await gs.GateModel.hcAccount.callApi(`Register`, {
            account: call.req.account,
            password: call.req.password
        })
    if (ret.isSucc) {
        call.succ({
            uid: ret.res.uid
        })
    }else {
        call.error(ret.err);
    }
}